package al.xc.task;

import java.util.HashMap;
import java.util.Map;

/**
 * 任务执行体管理
 */
public class LogicExecutorCenter {
    /**
     * 任务执行体
     */
    Map<ILogicExecutor.ExecutorKey, ILogicExecutor> task_executor_ = new HashMap<>();

    /**
     * 增加
     * @param type
     * @param index
     * @param executor
     */
    public void addExecutor(Integer type, int index, ILogicExecutor executor) {
        task_executor_.put(new ILogicExecutor.ExecutorKey(type, index), executor);
    }

    /**
     * 查找
     * @param type
     * @param index
     * @return
     */
    public ILogicExecutor findExecutor(Integer type, int index) {
        return task_executor_.get(new ILogicExecutor.ExecutorKey(type, index));
    }
}
